import { Token } from '@/types/data'
import { RootAction } from '@/types/store'
import { getToken } from '@/utils/storage'

const initValue:Token = getToken()
export default function login (state = initValue, action: RootAction) {
  if (action.type === 'login/Token') {
    return action.payload
  }
  return state
}
